package malus.shaofeng.com.beiwomusic.model;

import org.json.JSONObject;

import java.io.Serializable;

/**
 * 最热30贴
 */
public class HotPost implements Serializable {
    private static final long serialVersionUID=101l;
    private int post_id;
    private String title;
    private String image_uri;
    private int replies;
    private User user;
    private int views;
    //是否被置顶
    private boolean isTop;
    private boolean isUps;

    public void parseJSON(JSONObject object){
        post_id=object.optInt("post_id");
        title=object.optString("title");
        image_uri=object.optString("image_uri");
        replies =object.optInt("replies");
        views=object.optInt("views");
        JSONObject userObkect = object.optJSONObject("user");
        user=new User();
        if(userObkect!=null){
            user.parseJSON(userObkect);
        }
    }
    public int getPost_id() {
        return post_id;
    }

    public void setPost_id(int post_id) {
        this.post_id = post_id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage_uri() {
        return image_uri;
    }

    public void setImage_uri(String image_uri) {
        this.image_uri = image_uri;
    }

    public int getReplies() {
        return replies;
    }

    public void setReplies(int replies) {
        this.replies = replies;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public boolean isTop() {
        return isTop;
    }

    public void setTop(boolean isTop) {
        this.isTop = isTop;
    }

    public int getViews() {
        return views;
    }

    public void setViews(int views) {
        this.views = views;
    }

    public boolean isUps() {
        return isUps;
    }

    public void setUps(boolean isUps) {
        this.isUps = isUps;
    }
}
